//unoreder_map根据hash值判断元素是否存在于容器中
#include <unordered_map>
#include <string>
#include <map>
#include "include.h"
void test_unordered_map() {
    // 两组结构按同样的顺序初始化
    std::unordered_map<int, std::string> u = {
        {1, "AAA"},
        {3, "CCC"},
        {2, "BBB"}
    };
    std::map<int, std::string> v = {
        {1, "AAA"},
        {3, "BBB"},
        {2, "CCC"}
    };

    // 分别对两组结构进行遍历
    std::cout << "std::unordered_map" << std::endl;
    for( const auto & n : u) 
        std::cout << "Key:[" << n.first << "] Value:[" << n.second << "]\n";

    std::cout << std::endl;
    std::cout << "std::map" << std::endl;
    for( const auto & n : v) 
        std::cout << "Key:[" << n.first << "] Value:[" << n.second << "]\n";
}